package cn.heckman.springbatch.batchTask;

import cn.heckman.springbatch.entity.BlacklistDetectionVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.configuration.annotation.StepScope;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@StepScope
public class LjItemWriter implements org.springframework.batch.item.ItemWriter<BlacklistDetectionVo> {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Override
    public void write(List<? extends BlacklistDetectionVo> list) throws Exception {
        try {
            StringBuilder sb = new StringBuilder();
            for (BlacklistDetectionVo blacklistDetectionVo : list) {
//                sb.append(blacklistDetectionVo.getPhone() + ",");
//                System.out.println(JSONObject.toJSONString(blacklistDetectionVo));
            }
        } catch (Exception ex) {
            logger.error(ex.getMessage(), ex);
        }
    }
}